package cn.tx.shiro.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 描述
 * @Author：XiaoBing
 * @Date：2020/11/3 9:50
 * @Version：1.0
 */
@RestController
@RequestMapping("user")
public class UserController {
    @RequiresPermissions(value = {"person:query"})
    @RequestMapping("query")
    public Map<String, Object> query() {
        Map<String, Object> map = new HashMap<>();
        map.put("msg", "query权限");
        return map;
    }

    @RequiresPermissions(value = {"person:add"})
    @RequestMapping("add")
    public Map<String, Object> add() {
        Map<String, Object> map = new HashMap<>();
        map.put("msg", "add权限");
        return map;
    }

    @RequiresPermissions(value = {"person:update"})
    @RequestMapping("update")
    public Map<String, Object> update() {
        Map<String, Object> map = new HashMap<>();
        map.put("msg", "update权限");
        return map;
    }

    @RequiresPermissions(value = {"person:delete"})
    @RequestMapping("delete")
    public Map<String, Object> delete() {
        Map<String, Object> map = new HashMap<>();
        map.put("msg", "delete权限");
        return map;
    }

    @RequiresPermissions(value = {"person:export"})
    @RequestMapping("export")
    public Map<String, Object> export() {
        Map<String, Object> map = new HashMap<>();
        map.put("msg", "export权限");
        return map;
    }
}
